<template>
  <div>
    <el-form ref="form" :model="form">
      <el-form-item>
        <h3 style="text-align: left">单选题</h3>
        <el-form-item class="question"
          >{{ Tform.id }}、{{ Tform.question }}</el-form-item
        >
        <el-radio-group v-model="radio" class="checkboxGroup" >
          <el-radio :label="3" disabled>{{ Tform.selectA }}</el-radio>
          <el-radio :label="6" disabled>{{ Tform.selectB }}</el-radio>
          <el-radio :label="9" disabled>{{ Tform.selectC }}</el-radio>
          <el-radio :label="12" disabled>{{ Tform.selectD }}</el-radio>
        </el-radio-group>
        <div class="RadioAnswer">
          <el-form-item label="本题分数："></el-form-item>
          <el-form-item label="正确答案："></el-form-item>
          <el-form-item label="解析："></el-form-item>
        </div>
      </el-form-item>
      <!-- <div class="BoxTime">
        <el-form-item id="time-label" label="总成绩"></el-form-item>
      </div> -->
    </el-form>
  </div>
</template>

<script>
import { mapState } from "vuex";

export default {
  name: "MyRadio",
  data() {
    return {
      form: {
        type: [],
      },
      radio: 6,
    };
  },
  props: ["id"],
  computed: {
    ...mapState({ radioList: (state) => state.smy.radioList }),
    Tform() {
      return this.radioList[this.id - 1];
    },
  },
  // watch: {
  //   $router: {
  //     deep: true,
  //     handler: function (val) {
  //       this.from = this.radioList[val]
  //     }
  //   }
  // }
};
</script>

<style lang="scss" scoped>
.checkboxGroup {
  display: flex;
  /* justify-content: space-between; */
  align-items: flex-start;
  /* 转换主轴方向 */
  flex-direction: column;
  /* 文本缩进 */
  text-indent: 20px;
  /* 字符间距 */
  /* letter-spacing: 5px; */
}
::v-deep {
  .el-radio {
    line-height: 3;
    //添加边框
    /* border: 1px solid rgb(207, 204, 204); */
    //选中时边框的颜色
    /* &.is-checked {
        border: 1px solid #28d4c1 !important;
      } */
    //鼠标滑过改变字体和小圆圈边框的样式
    &:hover {
      border-color: #25a785 !important;
      color: #25a785 !important;
      //鼠标滑过时小圆点边框显示
      .el-radio__inner {
        border-color: #25a785;
      }
    }
    .el-radio__input {
      margin-bottom: px(5);
      //选中时的样式
      &.is-checked {
        .el-radio__inner {
          //选中时小圆圈的的颜色
          background-color: #25a785;
          border-color: #25a785;
        }
        + .el-radio__label {
          //选中时字体的颜色
          color: #25a785 !important;
        }
      }
      .el-radio__inner {
        // 鼠标滑过小圆点时的样式
        &:hover {
          border-color: #25a785;
        }
      }
    }
  }
  .el-form {
    #time-label .el-form-item__label {
      font-size: 40px;
    }
  }
}
.BoxTime {
  position: absolute;
  top: 140px;
  right: 80px;
  height: 100px;
  width: 200px;
  // background-color: pink;
}
.question {
  display: flex;
  // font-size: 20px;
}
</style>
